#ifndef _SAI_ROOM_H_
#define _SAI_ROOM_H_
#include "../sgame.h"
#include "../api/base.h"
#include "./object.h"
#include "./objsen.h"
#include "./camera.h"

typedef void(*sFunRmFun)(void*ob);
typedef void(*sFunRmEve)(int type,int p1,int p2);

//房间定义
typedef struct
{
 //所有obj
 sObjSen*sen;
 //摄像机
 sCam cam;
 
 //速度宽高
 int sp;
 int tim;
 int w;
 int h;
 
 //创建退出函数
 sFunRmFun create;
 sFunRmFun draw;
 sFunRmFun exit;
 sFunRmEve event;
}sRoom;

//当前房间
extern sRoom*_room;

//创建房间
extern sRoom*sNewRoom(int w,int h,int sp);

//房间跳转
extern void sGotoRoom(sRoom*rm);

//添加obj
extern void sRoomAddObj(sRoom*rm,sObj*obj);

extern void sDrawRoom(sRoom*rm);
extern void sDrawCurRoom();

//运行房间
extern void sRunRoom(sRoom*rm);

//运行当前房间
extern void sRunCurRoom();

//退出房间
extern void sExitRoom(sRoom*rm);

#endif


